{include file='../../../PublicView/include.html'}
<script src="/assets/gift_index.js"></script>
<div class="taeapp admin-table" cellpadding="0" cellspacing="0" border="0">
        <div class="taeapp admin-table-side  tips tips-small tips-notice tips-no-icon">
            <!--菜单部分-->
            <div class="taeapp admin-nav">
			{include file='../../../PublicView/shopleft.html'}
			</div>
            <!--菜单部分-->
        </div>
        <div class="taeapp admin-table-main">
            <!--内容部分-->
				<ul class="breadcrumb">
					<li><a href="/">互动到店</a> <span class="divider">/</span></li>
					<li>活动管理 <span class="divider">/</span></li>
					<li class="active">{$title}</li>
				</ul>
		
			<!--内容部分-->
			{include file='../../../PublicView/showmessage.html'}
			<div class="row">
			  <div id="tab">
					 <ul class="bui-tab nav-tabs">
					 {foreach from=$tools key=key item=item}
					 {if $item.status}
					 <li class="bui-tab-item {if $ctp==$key} bui-tab-item-selected{/if}" data-admin="{$admin}" data-tp="{$key}"><span class="bui-tab-item-text">{$item.name}</span></li>
					 {/if}
					 {/foreach}
					 <!-- <li><button class="button button-small button-success add" data-ctp="{$ctp}">发布活动</button></li> -->
					<!--  {if $type==9}
					 <li class="pull-right"><button class="button button-small button-success list" data-ctp="{$ctp}"><i class="icon icon-white icon-list"></i>列表</button></li>
					 {else}
					 <li class="pull-right"><button class="button button-small button-warning trash" data-ctp="{$ctp}"><i class="icon icon-white icon-trash"></i>回收站</button></li>
					 {/if} -->
					 <!-- <li><button class="button button-small button-danger"><i class="icon-white icon-trash"></i>删除内容</button></li>
					 <li><button class="button button-small button-inverse">修改内容</button></li> --></ul>
			  </div>
			  <div class="form-horizontal">
			  <table cellspacing="0" class="table table-bordered" style="border-top:none">
          <tbody>
            <tr>
              <th width="15"></th>
              <th width="52">开始时间</th>
              <th width="52">结束时间</th>
              <th width="50">状态</th>
              <th>标题</th>
			  {if $admin=="sendgifts"}
			  <th width="50">中奖人</th>
			  {/if}
            </tr>
		  {foreach key=key item=item from=$data}
            <tr class="re{$ctp}{$item.id}">
              <td><input type="checkbox"></td>
              <td>{$item.start_time}</td>
              <td>{$item.end_time}</td>
              <td class="status{$item.gid}">{if $item.status==0}<span class="label label-info">未发奖</span>{/if}
			      {if $item.status==1}<span class="label label-success">已发奖</span>{/if}
			      {if $item.status==2}<span class="label">已领取</span>{/if}
			      {if $item.status==3}<span class="label label-warning">催发奖</span>{/if}
				  {if $item.status==9}<span class="label label-inverse"><del>拒绝发奖</del></span>{/if}
				  {if $item.status==11}<span class="label label-info">尚未开始</span>{/if}
				  {if $item.status==12}<span class="label label-success">正在进行</span>{/if}
				  {if $item.status==13}<span class="label label-inverse">已经结束</span>{/if}
			  </td>
			  <td>
			  <a href="/?m=front&id={$item.id}&c=gift"  target="_blank" title="{$item.toolname}" >【{$item.title}】中的{$item.name}</a> 
			  {if $admin!="user"}
			  <a href="/?a=edit_gift&m=shop&c=gift&id={$key}&ctp={$ctp}"><i class="icon icon-green icon-edit"></i></a>
			  <a href="/?a=edit_gift&m=shop&c=gift&id={$key}&ctp={$ctp}"><i class="icon icon-green icon-gift"></i></a>
			  <a href="/?&m=front&id={$item.event_id}&ctp=eggs&c=event&a=show" target="_blank"><i class="icon icon-green icon-home"></i></a>
			   {if $admin=="sendgifts" && $item.status!=1 && $item.status!=2 }
			   <button class="button button-mini button-primary fajiang fa{$item.gid}" data-gid="{$item.gid}" data-gtp="{$ctp}" data-unick="{$item.usernick|default:""}"><i class="icon icon-white icon-user"></i>发奖</button>
			   {/if}
			   {if $item.status==1}
			   <button class="button button-mini fajiang fa{$item.gid}" data-gid="{$item.gid}" data-gtp="{$ctp}" data-unick="{$item.usernick|default:""}"><i class="icon icon-pencil"></i>修改</button>
			   {/if}
			  {/if}
			   {if $admin=="user" && $item.status!=1 && $item.status!=2 && !($ctp=="youhuiq"||$ctp=="baoyou"||$ctp=="zfbhb"||$ctp=="zhekou")}
			   <button class="button button-mini button-primary cuijiang" data-gid="{$item.gid}"><i class="icon icon-white icon-volume-up"></i>催奖</button>
			   {/if}
			   {if $item.status==1 && $ctp == "item"}
			   <a class="button button-mini button-success wuliu" href="http://trade.taobao.com/trade/detail/trade_item_detail.htm?bizOrderId={$item.tradeid}" target="_blank"><i class="icon icon-white icon-plane"></i>查物流</a>
			   {/if}
			   {if $admin=="user"  && ($ctp=="youhuiq"||$ctp=="baoyou"||$ctp=="zfbhb"||$ctp=="zhekou")}
			   <button class="button button-mini button-primary lingjiang" data-gid="{$item.gid}"><i class="icon icon-white icon-shopping-cart"></i>领奖</button>
			   {/if}
			   {if $admin=="user"}
			   <a class="button button-mini button-danger pingzheng pull-right" href="/?c=Certi&m=front&gid={$item.gid}" target="_blank"><i class="icon icon-white icon-camera"></i>凭证</a>
			   {/if}
			  <!-- {if $item.status!=1}<i class="curpoint icon icon-red icon-remove " data-ctp="{$ctp}" data-id="{$item.id}"></i>{/if} -->
			  <!-- {if $item.status==1}<a href="?m=front&id={$item.content_id}&ctp={$ctp}&a=show" target="_blank"><i class="curpoint icon icon-green icon-play " data-ctp="{$ctp}" data-id="{$item.id}"></i></a>{/if} -->
			  </td>
			   {if $admin=="sendgifts"}
			  <td>{if !$item.usernick}{$item.mixednick|default:"错误！"|truncate:8:"..."}{else}{$item.usernick|default:""}{/if}</td>
			   {/if}
            </tr>
		{/foreach}
          </tbody>
        </table>
		<div>
          <!-- <ul class="toolbar pull-left">
            <li><label class="checkbox"><input type="checkbox"><a href="#">全选</a></label></li>
            <li><button class="button button-danger"><i class="icon-white icon-trash"></i>批量删除</button></li>
            <li><button class="button button-success">审核通过</button></li>
            <li><button class="button button-inverse">审核不通过</button></li>
          </ul> -->
		  <div class="pagination pull-right" data-totalpg="{$totalpg}" data-curpg="{$curpg}" data-action="{$current}">
			{$page}
          </div>
        </div>
			  </div>
			</div>			
			<input type="hidden" class="type" value="{$type|default:0}" />
        <!--内容部分-->
        </div>
</div>